package cn.itsub.sodo;

import cn.itsub.sodo.core.Director;
import cn.itsub.sodo.core.types.Size;
import cn.itsub.sodo.core.types.Vec2;
import cn.itsub.sodo.run.Application;
import cn.itsub.sodo.timer.HiScheduler;
import cn.itsub.sodo.timer.UpdateCallback;
import cn.itsub.sodo.view.HiView;
import cn.itsub.sodo.view.SwingView;

public class cc {

    public static Director director = Director.getInstance();
    public static HiScheduler scheduler = HiScheduler.getInstance();

    private static Size frameSize = size(1280,720);		//窗体尺寸
    private static Size designSize = size(1280,720);		//画布尺寸

    /** 设置窗口像素尺寸，需要在init之前设置 */
    public static void setFrameSize(int width, int height) {
        cc.frameSize = size(width, height);
    }
    /** 设置设计像素尺寸，需要在init之前设置 */
    public static void setDesignSize(int width, int height) {
        cc.designSize = size(width, height);
    }
    public static void init() {
        HiView view = SwingView.create(frameSize, designSize);
        director.setView(view);
        director.setAnimationInterval(1.0f/90);
    }

    public static Vec2 v2(int x, int y) {
        return Vec2.create(x, y);
    }
    public static Size size(int width, int height) {
        return Size.create(width,height);
    }

}

